def common_node(headA, headB):
    nodeA, nodeB = headA, headB
    while nodeA != nodeB:
        nodeA = nodeA.next if nodeA else headB
        nodeB = nodeB.next if nodeB else headA
    return nodeA


from utils import cross_node1, cross_node2, print_list, list12345, list12321

ans = common_node(list12345, list12321)
print_list(ans)
